<template>
  <div class="chatHeader" @click="$store.commit('common/set_showLittlePopup')">
    <user-info></user-info>
    <more-operation @addFriend="addFriend" v-if="showOperation"></more-operation>
  </div>
</template>

<script>
import userInfo from './components/userInfo'
import moreOperation from './components/moreOperation'
export default {
  name: 'chatHeader',
  components: {
    userInfo,
    moreOperation
  },
  computed: {
    showOperation () {
      return this.$store.state.chatInformation.current_contact.id_type !== 0
    }
  },
  methods: {
    addFriend () {
      this.$store.commit('common/set_userInfoType', 1)
      this.$store.commit('common/set_ifShowUserInfo', true)
    }
  }
}
</script>

<style scoped lang="scss">
.chatHeader {
  height: 72px;
  padding: 15px 24px;
  border-bottom: 1px solid #dee3ec;
  position: relative;
}
</style>
